home *** CD-ROM | disk | FTP | other *** search
- scenario = GetProperties()
- scenario.ScenarioType = 1
- scenario.Title = "sc_Train_03_00"
- scenario.Map = "Beotorum.dat"
- scenario.Description = "sc_Train_03_01"
- scenario.Picture = "Train 03.dds"
- scenario.iSortOrder = 6
-
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
- scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_INVADE_COUNTRY] = false
-
- Player(PT_PLAYER, RACE_HUMANS)
- Player(PT_AI, RACE_ALIENS)
-
- SetInitialCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724024, 0.546580, 0.420760, 0.000000,0.472574, -0.837407, 0.274633, 0.000000,151.452988, 361.779846, -609.496460, 1.000000)
-
- function InitialMOB()
- StartMOB(1)
-
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_02a")
- SelectCountry(13)
- ShowXBallon(51, -1, MBS_RIGHT, 390, 471, "sc_Train_03_02")
- UnselectCountry(13)
-
- --FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724025, 0.546580, 0.420760, 0.000000, 0.472574, -0.837407, 0.274632, 0.000000, 406.109009, 361.779846, -461.505310, 1.000000)
- FlyCamera(0.393208, 0.000000, -0.919449, 0.000000, 0.917146, 0.070738, 0.392223, 0.000000,0.065040, -0.997495, 0.027815, 0.000000,616.987915, 411.910065, -355.193359, 1.000000)
-
- SelectCountry(14)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_03")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_04a")
- UnselectCountry(14)
-
- ShowObject(ARROW, 1, 65280, 50, 50, 7, 11, 9, 9)
- ShowObject(ARROW, 2, 65280, 30, 50, 7, 7, 9, 5)
- ShowBallon(3, -1, MBS_RIGHT, 11, 7, "sc_Train_03_04")
-
- HideObject(1)
- HideObject(2)
-
- FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.648178, 0.661797, 0.376683, 0.000000,0.572192, -0.749683, 0.332524, 0.000000,386.551910, 180.057861, -472.870697, 1.000000)
- SelectUnit2(4098)
- SelectUnit2(4099)
- SelectUnit2(4100)
- SelectUnit2(4101)
- SelectUnit2(4102)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_05")
- UnselectUnit(4098)
- UnselectUnit(4099)
- UnselectUnit(4100)
- UnselectUnit(4101)
- UnselectUnit(4102)
-
- FlyCamera(0.502456, 0.000000, -0.864603, 0.000000, 0.724025, 0.546580, 0.420760, 0.000000, 0.472574, -0.837407, 0.274632, 0.000000, 406.109009, 361.779846, -461.505310, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_06")
-
- FinishMOB()
- end
-
- function OnHexClicked(x, y, clicked_unit, selected_unit, command)
- if GetMoney(14, MONEY_GUERRILLA) > 0 and command == CMD_MOVE then
- if GetType(selected_unit) == TANK then
- local pos = GetPos(selected_unit)
- if x ~= (pos.x + 1) or y ~= (pos.y - 1) then
- IncorrectAction("sc_Train_03_17")
- end
- end
-
- if selected_unit == 4102 then
- if x < 6 then
- IncorrectAction("sc_Train_03_18")
- end
- end
- end
- end
-
- old_prompt = ""
-
- local bCanEndPhase = false
-
- function OnUpdate()
- bCanEndPhase = false
-
- if not AllUnitsMovedAndFiredIfCould() then
- if GetMoney(14, MONEY_GUERRILLA) > 0 then
- if GetMP(4098) + GetMP(4099) + GetMP(4100) + GetMP(4101) > 0 then
- ShowPrompting("sc_Train_03_07")
- elseif GetMP(4102) > 0 then
- ShowPrompting("sc_Train_03_08")
- end
- else
- if GetAliveUnitsAmount(COLOR_RED) > 0 then
- ShowPrompting("sc_Train_03_09")
- else
- ShowPrompting("sc_Train_03_10")
- end
- end
- else
- ShowPrompting("sc_Train_finish_phase")
- bCanEndPhase = true
- end
- end
-
- local bJustInvaded14 = false
-
- function OnEndTurn()
- if IsInvaded(14) then
- StartMOB(1)
- FlyCamera(-0.323464, 0.000000, 0.946240, 0.000000, -0.557854, 0.807733, -0.190698, 0.000000,-0.764310, -0.589548, -0.261273, 0.000000,874.347168, 246.382706, -199.597382, 1.000000)
-
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_11")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_11a")
- ShowXBallon(51, -1, MBS_CENTER, 300, 320, "sc_Train_03_11b")
- Money(14, MONEY_GUERRILLA, 0)
- SetupUnit( 1, BUNKER, 9, 5 )
- SetupUnit( 2, BUNKER, 9, 7 )
- SetupUnit( 3, BUNKER, 9, 9 )
- SetupUnit( 4, BUNKER, 10, 10 )
- SetupUnit( 5, BUNKER, 10, 12 )
- SetupUnit( 6, BUNKER, 10, 8 )
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_12")
- bJustInvaded14 = true
- FinishMOB(1)
- end
- end
-
- function OnEndAITurn()
- if bJustInvaded14 then
- StartMOB(1)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_13a")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_13")
- ShowXBallon(51, -1, MBS_CENTER, 300, 340, "sc_Train_03_13b")
- bJustInvaded14 = false
- FinishMOB(1)
- end
- end
-
- function OnUnitDead(unit)
- if GetAliveUnitsAmount(COLOR_RED) == 0 and GetCapitalControl(14) == COLOR_RED then
- StartMOB(1)
- StoreCamera()
- FlyCamera(-0.131823, 0.000000, -0.991273, 0.000000, 0.882500, 0.455435, -0.117358, 0.000000, 0.451461, -0.890269, -0.060037, 0.000000, 535.552368, 422.650391, -264.117493, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_03_14")
- RestoreCamera()
- FinishMOB()
- end
- end
-
- function OnCapitalCaptured(country, color)
- if(country == 14 and color == COLOR_GREEN) then
- if (GetAliveUnitsAmount(COLOR_RED) > 0) then
- StartMOB(1)
- StoreCamera()
- FlyCamera(-0.974395, 0.000000, -0.224844, 0.000000, 0.211247, 0.342481, -0.915468, 0.000000, 0.077005, -0.939525, -0.333712, 0.000000, 622.301758, 361.820587, -132.521454, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 320, "sc_Train_03_15")
- FinishMOB()
- end
- end
- end
-
- function OnCountryCaptured(country, color)
- if(country == 14 and color == COLOR_GREEN) then
- StartMOB(1)
- ShowXBallon(51, -1, MBS_CENTER, 300, 400, "sc_Train_03_16")
- ShowXBallon(51, -1, MBS_CENTER, 300, 400, "sc_Train_03_16a")
- FinishMOB()
- end
- end
-
- function OnEndPhase( phase )
- if GetTurnNumber( COLOR_GREEN ) == 0 and phase == PHASE_COMBAT then
- if not bCanEndPhase then
- IncorrectAction("sc_Train_01_05")
- end
- end
- end
-
- function CheckForVictory()
- if(GetCountryControl(14) == COLOR_GREEN) then return GAMERESULT_VICTORY end
- if(GetCountryControl(14) == COLOR_RED) then return GAMERESULT_DEFEAT end
- return GAMERESULT_NONE
- end
-
- function InitialSetup()
-
- Country(13, ALLIANCE_FNU_ALLY)
- Money(13, MONEY_TOTAL_REVENUE, 0)
- Country(14, ALLIANCE_NEUTRAL)
- Money(14, MONEY_GUERRILLA, 6)
- Money(14, MONEY_TOTAL_REVENUE, 0)
- SetupUnit(4098, TANK, 7, 7)
- SetupUnit(4099, TANK, 7, 9)
- SetupUnit(4100, TANK, 7, 11)
- SetupUnit(4101, TANK, 8, 12)
- SetupUnit(4102, HBOT, 6, 10)
-
- end
-